<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>客户列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="__PUBLIC__/css/layui.css" rel="stylesheet" type="text/css"/>
    <link href="__PUBLIC__/css/admin.css" rel="stylesheet" type="text/css"/>
    <link href="__PUBLIC__/css/public.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="__PUBLIC__/css/looklayer.css"  media="all">
    <style>
        .layui-layer-setwin .layui-layer-close2  {
            position: relative !important;
            right: 0!important;
            top:0 !important;
        }

    </style>
</head>
<body>
<div class="layui-conter">
    <div class="layui-col-md12">
        <div class="navigation">
            <span>销售></span><span>客户列表</span>
        </div>

        <div class="white-conter">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="title-blue">客户列表</div>
                    <div class="layui-card-body addPadding">
                        <form class="layui-form" action="" lay-filter="component-form-group">
                            <div class="layui-form-item">
                                <label class="layui-form-label">高级搜索：</label>
                                <div class="layui-input-block">
                                    <div class="layui-col-xs4">
                                        <input style="background: #dce6f0;border: none" type="text" name="title" lay-verify="title" autocomplete='email' placeholder="姓名/编号/身份证/电话/邮箱..." class="layui-input">
                                    </div>
                                    <button class="layui-btn layui-btn-sm layui-btn-normal" style="margin: 0 25px;vertical-align: text-top;">搜索</button>
                                    <div class="more">更多筛选 <i class="layui-icon layui-icon-up"></i></div>
                                </div>
                            </div>
                            <div class="more_show" style="display: none;">
                                <div class=" layui-row" style="margin-top: 20px">
                                    <div class=" layui-col-xs3">
                                        <label class="layui-form-label">姓名：</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请选择" name="studentName" class="layui-input">
                                        </div>
                                    </div>
                                    <div class=" layui-col-xs3">
                                        <label class="layui-form-label">咨询课程：</label>
                                        <div class="layui-input-block">
                                            <select name="quiz2">
                                                <option value="" selected="">请选择</option>
                                                <option value="1" >1</option>
                                                <option value="2">2</option>
                                                <option value="3">3</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class=" layui-col-xs3">
                                        <label class="layui-form-label">咨询时间：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="signTime" id="signTime" lay-verify="date" placeholder="请选择"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class=" layui-col-xs3">
                                        <label class="layui-form-label">媒体渠道：</label>
                                        <div class="layui-input-block">
                                            <select name="quiz2">
                                                <option value="" selected="">请选择</option>
                                                <option value="1" >1</option>
                                                <option value="2">2</option>
                                                <option value="3">3</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-top: 20px">
                                    <div class="layui-col-xs3">
                                        <label class="layui-form-label">来源：</label>
                                        <div class="layui-input-block">
                                            <select name="quiz2">
                                                <option value="" selected="">请选择</option>
                                                <option value="1" >1</option>
                                                <option value="2">2</option>
                                                <option value="3">3</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs3">
                                        <label class="layui-form-label">咨询编号：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="serialNumber" placeholder="请选择" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs3">
                                        <label class="layui-form-label">回访时间：</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="signTime" id="data" lay-verify="date" placeholder="请选择"  class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-col-xs3">
                                        <label class="layui-form-label">咨询顾问：</label>
                                        <div class="layui-input-block">
                                            <select name="quiz2">
                                                <option value="" selected="">请选择</option>
                                                <option value="1" >1</option>
                                                <option value="2">2</option>
                                                <option value="3">3</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>


                        </form>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <table  class="layui-hide" id="test-table-operate" lay-filter="test-table-operate"></table>
                            <div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1">
                                <div class="layui-table-box" style="margin-bottom: 20px">
                                    <div class="layui-table-body layui-table-main">
                                        <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                                            <thead>
                                            <tr>
                                                <th data-field="id">
                                                    <div class="layui-table-cell">
                                                        <span>客户编号</span>
                                                        </span>
                                                    </div>
                                                </th>
                                                <th data-field="username">
                                                    <div class="layui-table-cell " align="center">
                                                        <span>姓名</span>
                                                    </div>
                                                </th>
                                                <th data-field="source">
                                                    <div class="layui-table-cell" align="center">
                                                        <span>渠道来源</span>
                                                    </div>
                                                </th>
                                                <th data-field="time">
                                                    <div class="layui-table-cell" align="center">
                                                        <span>上次回访时间</span>
                                                    </div>
                                                </th>
                                                <th data-field="consultant">
                                                    <div class="layui-table-cell " align="center">
                                                        <span>回访顾问</span>
                                                    </div>
                                                </th>
                                                <th data-field="information">
                                                    <div class="layui-table-cell" align="center">
                                                        <span>最后回访信息</span>
                                                    </div>
                                                </th>
                                                <th data-field="operation">
                                                    <div class="layui-table-cell" align="center">
                                                        <span>操作</span>
                                                    </div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody>
																						<foreach name="sc_data" item="s">
                                            <tr data-index="0" class="">
                                                <td data-field="id" align="center">
                                                    <div class="layui-table-cell">{$s.student_id}</div>
                                                </td>
                                                <td data-field="username" align="center">
                                                    <div class="layui-table-cell">{$s.name} </div>
                                                </td>
                                                <td data-field="source" align="center">
                                                    <div class="layui-table-cell ">{$s.am_name} </div>
                                                </td>
                                                <td data-field="time" align="center">
                                                    <div class="layui-table-cell ">{$s.record_data.start_time}</div>
                                                </td>
                                                <td data-field="consultant" align="center">
                                                    <div class="layui-table-cell">{$s.xs_name}</div>
                                                </td>
                                                <td data-field="information" align="center">
                                                    <div class="layui-table-cell"> {$s.record_data.content|mb_substr=0,20,'utf-8'}</div>
                                                </td>
                                                <td data-field="operation" align="center">
                                                    <div class="layui-table-cell ">
																												<button data-method="offset" data-type="auto" onclick="window.location.href='{:U('Customer/detailedInformation?id='.$s['id'])}'"  class="img-but look-img"></button>
																												<button data-method="offset" data-type="auto"  class="img-but" onclick="student_add({$s.id})">+</button>
                                                    </div>
                                                </td>
                                            </tr>
																						</foreach>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
																<ul class="pagination pagination-large"><span class="rows">共{$count}条记录</span></ul>
                                <div class="layui-table-page">
                                		<div id="layui-table-page1">
                                				<div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1">
                                					{$page}
                                				</div>
                                		</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="__PUBLIC__/js/layui.all.js"></script>
<script src="__PUBLIC__/js/jquery.js"></script>
<script>
    layui.use( ['form','layer','laydate','element'], function(){
        var  form = layui.form
            , $ = layui.jquery
            ,layer = layui.layer
            ,element = layui.element
            , laydate = layui.laydate;
        element.render();
        //触发事件
        var shows=false;
        $('.more').on('click',function(){
            if(shows == false){
                $('.more_show').show()
                $(this).find('.layui-icon').removeClass('layui-icon-up')
                $(this).find('.layui-icon').addClass('layui-icon-down')
                shows=true;
                console.log()
            }else if(shows == true){
                $('.more_show').hide()
                $(this).find('.layui-icon').removeClass('layui-icon-down')
                $(this).find('.layui-icon').addClass('layui-icon-up')
                shows=false
                console.log(12)
            }

        })
        //执行一个laydate实例
        laydate.render({
            elem: '#signTime' //指定元素
        });
        laydate.render({
            elem: '#data' //指定元素
        });
    });
</script>
<script>
function search(){
	var scid = $('#scid').val();
	var date = $('#date').val();
	window.location.href="{:U('Customer/CustomerList')}?scid="+scid+"&date="+date;
}
function student_add(id){
	$.post("{:U('Customer/CustomerPool')}",{id:id},function(data){
		if(data==1){
			alert('抽取客户成功！');
			window.location.href="{:U('Customer/CustomerList')}";
		}else{
			alert('抽取失败！');
			window.location.href="{:U('Customer/CustomerList')}";
		}
	})
}
</script>
</html>